import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

import 'found_rank_mod.dart';
import 'found_six_mod.dart';

class found_tabs extends StatefulWidget {
  found_tabs({Key key, this.tage}) : super(key: key);
  int tage;
  @override
  State<found_tabs> createState() => _found_tabsState();
}

class _found_tabsState extends State<found_tabs> {
  List<String> imageList = [
    "http://www.itying.com/images/flutter/1.png",
    "http://www.itying.com/images/flutter/2.png",
    "http://www.itying.com/images/flutter/3.png"
  ];
  @override
  Widget build(BuildContext context) {
    return RefreshIndicator(
      onRefresh: () async {
        //模拟网络请求
        print('上拉刷新');
        // print(cartoon_list0);
        await Future.delayed(Duration(milliseconds: 2000));
        //结束刷新
        return Future.value(true);
      },
      child: ListView(
        physics: const BouncingScrollPhysics(),
        children: [
          Container(
            margin: EdgeInsets.only(top: 00, bottom: 0),
            padding: EdgeInsets.only(top: 10, bottom: 2),
            height: 290,
            // color: colorL[i],
            // color: Color.fromRGBO(80, 200, 255, 1),
            child: new Swiper(
              itemBuilder: (BuildContext context, int index) {
                return new Image.network(
                  imageList[index],
                  fit: BoxFit.cover,
                );
              },
              onIndexChanged: (index) {},
              itemCount: imageList.length,
              viewportFraction: 0.6,
              scale: 0.6,
              loop: true,
              autoplay: true,
              duration: 1000,
              autoplayDelay: 5000,
            ),
          ),
          found_six_mod(title_id: 1007),
          found_rank_mod(
            rank_id: 1007,
          ),
          found_six_mod(title_id: 1007),
          Container(
            height: 60,
          )
        ],
      ),
    );
  }
}
